class CreateLoanDeliveryHxDetails < ActiveRecord::Migration
  def self.up
    create_table :loan_delivery_hx_details do |t|
      t.integer :loan_delivery_hx_id     ,:null => false          #出库单ID
      t.integer :product_id           ,:null => false          #产品的编号
      t.integer :quantity             ,:default => 0          #产品的数量
      t.string  :description                    #写一些备注之类的信息
      t.integer :is_locked     , :limit => 1    , :default => 0 #锁定 1为True 0为False
      t.integer :lock_version  , :default => 0  #乐观锁
      t.timestamps
    end
  end

  def self.down
    drop_table :loan_delivery_hx_details
  end
end
